# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Gmail.V1.Model.FilterCriteria do
  @moduledoc """
  Message matching criteria.

  ## Attributes

  *   `excludeChats` (*type:* `boolean()`, *default:* `nil`) - Whether the response should exclude chats.
  *   `from` (*type:* `String.t`, *default:* `nil`) - The sender's display name or email address.
  *   `hasAttachment` (*type:* `boolean()`, *default:* `nil`) - Whether the message has any attachment.
  *   `negatedQuery` (*type:* `String.t`, *default:* `nil`) - Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
  *   `query` (*type:* `String.t`, *default:* `nil`) - Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.
  *   `size` (*type:* `integer()`, *default:* `nil`) - The size of the entire RFC822 message in bytes, including all headers and attachments.
  *   `sizeComparison` (*type:* `String.t`, *default:* `nil`) - How the message size in bytes should be in relation to the size field.
  *   `subject` (*type:* `String.t`, *default:* `nil`) - Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
  *   `to` (*type:* `String.t`, *default:* `nil`) - The recipient's display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :excludeChats => boolean() | nil,
          :from => String.t() | nil,
          :hasAttachment => boolean() | nil,
          :negatedQuery => String.t() | nil,
          :query => String.t() | nil,
          :size => integer() | nil,
          :sizeComparison => String.t() | nil,
          :subject => String.t() | nil,
          :to => String.t() | nil
        }

  field(:excludeChats)
  field(:from)
  field(:hasAttachment)
  field(:negatedQuery)
  field(:query)
  field(:size)
  field(:sizeComparison)
  field(:subject)
  field(:to)
end

defimpl Poison.Decoder, for: GoogleApi.Gmail.V1.Model.FilterCriteria do
  def decode(value, options) do
    GoogleApi.Gmail.V1.Model.FilterCriteria.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Gmail.V1.Model.FilterCriteria do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
